﻿
namespace Patterns4Net.ArchitectureExplorer.ViewModels.Graph
{
    using System;
    using System.Diagnostics.Contracts;
    using Patterns4Net.ArchitectureExplorer.Diagram;

    public interface IGraphViewModelFactory
    {
        GraphViewModel CreateGraphForPackage(DiagramViewModel diagramViewModel, Package package);

        GraphViewModel CreateGraphForLayer(DiagramViewModel diagramViewModel, Layer layer);

        GraphViewModel CreateGraphForType(DiagramViewModel diagramViewModel, TypeInfo type);

        GraphViewModel CreateGraphForDiagram(DiagramViewModel diagramViewModel, Diagram diagram);
    }

    public abstract class IGraphViewModelFactoryContract : IGraphViewModelFactory
    {
        public GraphViewModel CreateGraphForPackage(DiagramViewModel diagramViewModel, Package package)
        {
            Contract.Requires(diagramViewModel != null);
            Contract.Requires(package != null);
            Contract.Ensures(Contract.Result<GraphViewModel>() != null);
            throw new NotSupportedException();
        }

        public GraphViewModel CreateGraphForLayer(DiagramViewModel diagramViewModel, Layer layer)
        {
            Contract.Requires(diagramViewModel != null);
            Contract.Requires(layer != null);
            Contract.Ensures(Contract.Result<GraphViewModel>() != null);
            throw new NotSupportedException();
        }

        public GraphViewModel CreateGraphForType(DiagramViewModel diagramViewModel, TypeInfo type)
        {
            Contract.Requires(diagramViewModel != null);
            Contract.Requires(type != null);
            Contract.Ensures(Contract.Result<GraphViewModel>() != null);
            throw new NotSupportedException();
        }

        public GraphViewModel CreateGraphForDiagram(DiagramViewModel diagramViewModel, Diagram diagram)
        {
            Contract.Requires(diagramViewModel != null);
            Contract.Requires(diagram != null);
            Contract.Ensures(Contract.Result<GraphViewModel>() != null);
            throw new NotSupportedException();
        }
    }
}
